<style type="text/css">
    .content {
        padding: 25px 20px;
    }

    /* 订单详情 */
    .order-detail .order-block {
        height: 31px;
        line-height: 31px;
        background: #e8edf0;
        border-radius: 13px;
        font-size: 14px;
        text-align: center;
        position: relative;
        margin-bottom: 50px;
    }

    .order-detail .order-block:before,
    .order-detail .order-block:after {
        content: "";
        position: absolute;
        z-index: 2;
        left: 0;
        top: 0;
        bottom: 0;
        border-radius: 13px;
        background: #18bc9c;
    }

    .order-detail .order-block:after {
        background: #4dc7af;
        z-index: 1;
    }

    .order-detail .order-block.progress-1:before {
        width: 0;
    }

    .order-detail .order-block.progress-1:after {
        width: 20%;
    }

    .order-detail .order-block.progress-2:before {
        width: 20%;
    }

    .order-detail .order-block.progress-2:after {
        width: 40%;
    }

    .order-detail .order-block.progress-3:before {
        width: 40%;
    }

    .order-detail .order-block.progress-3:after {
        width: 60%;
    }

    .order-detail .order-block.progress-4:before {
        width: 60%;
    }

    .order-detail .order-block.progress-4:after {
        width: 80%;
    }

    .order-detail .order-block.progress-5:before {
        width: 100%;
    }

    .order-detail .order-block.progress-5:after {
        width: 100%;
    }

    .order-detail .order-block.progress-5 li:nth-child(5) {
        color: #fff;
    }

    .order-detail .order-block li {
        width: 20%;
        float: left;
        list-style-type: none;
        border-radius: 13px;
        position: relative;
        z-index: 3;
    }

    .order-detail .order-block .tip {
        font-size: 12px;
        padding-top: 10px;
        color: #717171;
    }

    .order-detail .order-block.progress-1 li:nth-child(1),
    .order-detail .order-block.progress-2 li:nth-child(1),
    .order-detail .order-block.progress-3 li:nth-child(1),
    .order-detail .order-block.progress-4 li:nth-child(1),
    .order-detail .order-block.progress-5 li:nth-child(1) {
        color: #fff;
    }

    .order-detail .order-block.progress-2 li:nth-child(2),
    .order-detail .order-block.progress-3 li:nth-child(2),
    .order-detail .order-block.progress-4 li:nth-child(2),
    .order-detail .order-block.progress-5 li:nth-child(2) {
        color: #fff;
    }

    .order-detail .order-block.progress-3 li:nth-child(3),
    .order-detail .order-block.progress-4 li:nth-child(3),
    .order-detail .order-block.progress-5 li:nth-child(3) {
        color: #fff;
    }

    .order-detail .order-block.progress-4 li:nth-child(4),
    .order-detail .order-block.progress-5 li:nth-child(4) {
        color: #fff;
    }

    .order-detail .td__order-price {
        width: 200px;
        display: inline-block;
    }

    .order-head {
        width: 100%;
        padding: 12px 20px;
        margin-top: 60px;
        /* margin-bottom: 20px; */
        /* border-bottom: 1px solid #eef1f5; */
    }

    .order-head:not(:first-child) {
        margin-top: 0;
    }

    .order-head .title {
        position: relative;
        font-size: 1.5rem;
        color: #333;
    }

    .order-head .title::before {
        content: '';
        position: absolute;
        width: 4px;
        height: 14px;
        background: #18bc9c;
        top: 4px;
        left: -12px;
    }

    .table-responsive .table>tbody>tr>td {
        text-align: center;
        vertical-align: middle;
        color: #676767;
    }

    .ordertext {
        margin: 0 30px;
    }

    .table-bordered {
        border: 1px solid #e8edf0;
    }

    .table-bordered>thead>tr>th,
    .table-bordered>tbody>tr>th,
    .table-bordered>tfoot>tr>th,
    .table-bordered>thead>tr>td,
    .table-bordered>tbody>tr>td,
    .table-bordered>tfoot>tr>td {
        border: 1px solid #e8edf0;
    }

    .table thead tr {
        background: #f8f9fb;
    }

    .order_price span {
        width: 70px;
        display: inline-block;
        text-align: right;
    }
</style>
<div class="order-detail">
    {php}
        if( $row['paid'] == 0 ){
            $step = 1;
        }elseif( $row['paid'] == 1 && $row['status'] == 0 ){
            $step = 2;
        }elseif( $row['paid'] == 1 && ( $row['status'] == 1 || $row['status'] == 2 )){
            $step = 3;
        }elseif( $row['paid'] == 1 && ( $row['status'] == 3 || $row['status'] == 4) ){
            $step = 4;
        }elseif( $row['paid'] == 1 && $row['status'] == 5 ){
            $step = 5;
        }
    {/php}
    <ul class="order-block progress-{$step}">
        <li>
            <span>下单时间</span>
            <div class="tip">{$row.createtime?datetime($row.createtime):''}</div>
        </li>
        <li>
            <span>付款时间</span>
            <div class="tip">{$row.paidtime?datetime($row.paidtime):''}</div>
        </li>
        <li>
            <span>接单时间</span>
            <div class="tip">{$row.receivetime?datetime($row.receivetime):''}</div>
        </li>
        <li>
            <span>到达时间</span>
            <div class="tip">{$row.reachtime?datetime($row.reachtime):''}</div>
        </li>
        <li>
            <span>结束时间</span>
            <div class="tip">{$row.dealtime?datetime($row.dealtime):''}</div>
        </li>
    </ul>
</div>
<div class="row">
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">订单信息</div>
            <div class="panel-body">
                <p><span>订单号：</span><small>{$row.order_no}</small> <span style="margin-left: 30px;">买家：</span><small>{$row.user.nickname}</small><strong></strong></p>
                <table class="table table-bordered">
                    <thead>
                    <tr>
                        <th class="text-center">
                            <div class="th-inner">主图</div>
                        </th>
                        <th class="text-center">
                            <div class="th-inner">服务名称</div>
                        </th>
                        <th class="text-center">
                            <div class="th-inner">服务价格</div>
                        </th>
                    </tr>
                    </thead>
                    <tbody>

                    <tr>
                        <td><a href="javascript:"><img class="img-sm img-center"
                                                       src="{$row.service.image|cdnurl|htmlentities}"></a></td>
                        <td><strong>{$row.service.title}</strong></td>
                        <td>{$row.service.price}</td>
                    </tr>

                    </tbody>
                    <tfoot>
                    <tr>
                        <th colspan="10" style="text-align: right;">
                            <span class="ordertext">总价：<samp class="text-red">￥{$row.total_price}</samp></span>
                            <span class="ordertext">路费：￥{$row.travel_expenses}</samp> </span>
                            <span class="ordertext">优惠金额：<samp class="text-red">￥{$row.coupon_price}</samp> </span>
                            <span class="ordertext">实际支付：<samp class="text-red">￥{$row.pay_price}</samp></span>
                        </th>
                    </tr>
                    </tfoot>
                </table>
                <div style="color: #333;">
                    <p style="margin-bottom: 15px;">支付方式：
                        {switch name="row.pay_type"}
                        {case value="1"}<span class="label label-success">微信</span>{/case}
                        {case value="2"}<span class="label label-info">支付宝</span>{/case}
                        {case value="3"}<span class="label label-warning">余额</span>{/case}
                        {/switch}
                    </p>
                    <p style="margin-bottom: 15px;">交易状态：
                        {switch name="row.state"}
                        {case value="-1"}<span class="label label-info">待付款</span>{/case}
                        {case value="0"}<span class="label label-info">待接单</span>{/case}
                        {case value="1"}<span class="label label-warning">服务中</span>{/case}
                        {case value="2"}<span class="label label-primary">已完成</span>{/case}
                        {case value="7"}<span class="label label-success">已取消</span>{/case}
                        {/switch}
                    </p>
                    {neq name="row.coupon_id" value="0"}
                    <p>优惠折扣：{$row.coupon.name}
                    </p>
                    {/neq}
                    <p>买家备注：{$row.mark}</small></p>

                </div>
            </div>
        </div>
    </div>


    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">学生姓名：{$row.student_name}</div>
            <div class="panel-body">
                <table class="table table-striped">
                    <tbody>
                    <tr>
                        <td>学校地址</td>
                        <td>{$row.school_addr}</td>
                    </tr>
                    <tr>
                        <td>家庭地址</td>
                        <td>{$row.home_addr}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">付款信息</div>
            <div class="panel-body">
                <table class="table table-striped">
                    <tbody>
                    <tr>
                        <td>交易号</td>
                        <td>{$row.order_no}</td>
                    </tr>
                    <tr>
                        <td>支付方式</td>
                        <td>{switch name="row.pay_type"}
                            {case value="1"}微信{/case}
                            {case value="2"}支付宝{/case}
                            {case value="3"}余额{/case}
                            {/switch}
                        </td>
                    </tr>
                    <tr>
                        <td>交易订单号</td>
                        <td>{$row.trade_no}</td>
                    </tr>
                    <tr>
                        <td>付款状态</td>
                        <td>{if $row.paid == '1'}已支付{else}未支付{/if}</td>
                    </tr>
                    <tr>
                        <td>付款时间</td>
                        <td>{:$row.paidtime?datetime($row.paidtime):''}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    {if $row.extra}

    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">加钟信息</div>
            <div class="panel-body">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th class="text-center">
                            <div class="th-inner">交易流水号</div>
                        </th>
                        <th class="text-center">
                            <div class="th-inner">服务名称</div>
                        </th>
                        <th class="text-center">
                            <div class="th-inner">服务时长</div>
                        </th>
                        <th class="text-center">
                            <div class="th-inner">服务价格</div>
                        </th>
                        <th class="text-center">
                            <div class="th-inner">支付方式</div>
                        </th>
                    </tr>
                    </thead>

                    <tbody>
                    {foreach $row['extra'] as $extra}
                    <tr>
                        <td class="text-center">{$extra.order_no}</td>
                        <td class="text-center"><strong>{$extra.title}</strong></td>
                        <td class="text-center">{$extra.duration}小时</td>
                        <td class="text-center">{$extra.price}</td>
                        <td class="text-center">
                            {switch name="$extra.pay_type"}
                            {case value="1"}<span class="label label-success">微信</span>{/case}
                            {case value="2"}<span class="label label-info">支付宝</span>{/case}
                            {case value="3"}<span class="label label-warning">余额</span>{/case}
                            {/switch}
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>

                </table>
            </div>
        </div>
    </div>

    {/if}
</div>





<div class="hide layer-footer">
    <label class="control-label col-xs-12 col-sm-2"></label>
    <div class="col-xs-12 col-sm-8">
        <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
    </div>
</div>
